package com.example.myspringboot.mapper;

import com.example.myspringboot.model.myData;
import org.apache.ibatis.annotations.*;

@Mapper
public interface DataMapper {
//	/**
//	 * 用户id
//	 * @param id
//	 * 用户昵称
//	 * @param username
//	 * 信息来源地址
//	 * @param address
//	 *
//	 * @return
//	 */
	@Insert("insert  into user (id,username,address) values(#{id}, #{username}, #{address})")
	void insert(@Param("id") String id,
			   @Param("username") String username,
			   @Param("address") String address);
	
	@Results({
			@Result(property = "id",column = "id"),
			@Result(property = "username",column = "username"),
			@Result(property = "address",column = "address"),
	})
	@Select("select * from user where id = #{id}")
	myData findById(@Param("id") String id);

	
	/**
	 * 删除该id对应的信息
	 *

	 */
	@Delete("delete from user where id =#{id}")
	void delete(String id);
	
}
